//不要给我WA WA 叫
//一定AC
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <iomanip>
#include <climits>
#define int long long 
#define x first 
#define y second 
using namespace std;
const int N = 1e5 + 10;
int a[N];
void solve()
{
     int n,m;
     cin >> n >> m;
     vector<char> vc(n);
     for(int i = 0; i < n; i++) vc[i] = '1';
     for(int j = 1 ; j <= m; j++)
     {
        for(int i = 0; i < n; i++)
        {
            if((i + 1) % j == 0)
            {
                if(vc[i] == '1') vc[i] = '0';
                else vc[i] = '1';
            }
        }
     }
     int b[5050] = {0};
     int k = 0;
     for(int i = 0; i < vc.size(); i++)
     {
        if(vc[i] == '0')  b[++k] = i + 1;
     }
     if(k == 1) 
     {
         cout << b[k] << endl;
         return;
     }
     for(int i = 1; i <= k - 1; i++)
     {
        cout << b[i] << ",";
     } 
     cout << b[k] << endl;
}
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr),cout.tie(nullptr);
    int t = 1;
    while(t -- )  solve();
    return 0;
}
